package com.ruixin.bean;

import com.ruixin.base.proxy.ProxyHelper;
import com.sun.istack.internal.NotNull;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by Ruixin
 * Description:Bean对象
 */
public class BeanObject {

    //bean对象
    private Object bean;

    //bean的别名
    private String beanName;

    //这个bean的class对象
    private Class<?> beanClass;

    public BeanObject(@NotNull String beanName,@NotNull Object bean){
        this.bean = bean;
        this.beanName = beanName;
        Class<?> aClass = bean.getClass();
        this.beanClass = ProxyHelper.getOriginalClass(aClass);
    }

    public BeanObject(String beanName,Class<?> clz){
        this.beanName = beanName;
        this.beanClass = clz;
    }

    public Class<?> getBeanClass() {
        return beanClass;
    }

    public void setBeanClass(Class<?> beanClass) {
        this.beanClass = beanClass;
    }

    public String getBeanName() {
        return beanName;
    }

    public void setBeanName(String beanName) {
        this.beanName = beanName;
    }

    public Object getBean() {
        return bean;
    }

    public void setBean(Object bean) {
        this.bean = bean;
    }

}
